Fix provenance issues#100
Merged
ParkMyCar merged 5 commits intoParkMyCar:mainfrom Jun 11, 2022
Noratrieb:fix-provenance-issues
Merged
Fix provenance issues#100ParkMyCar merged 5 commits intoParkMyCar:mainfrom Noratrieb:fix-provenance-issues
ParkMyCar merged 5 commits intoParkMyCar:mainfrom
Noratrieb:fix-provenance-issues
Conversation
When creating a `BoxString` using `from_string` or `from_box_str`, `str::as_ptr` was used to get the pointer, which only has read provenance for the initialized part of the string. Going through `Vec` in the `from_string` and through `Box::into_raw` in the `from_box_str` case fixed the issue.
BoxedString not having the right provenanceBefore, it used a zero length array to signal it being a fake DST. This is not allowed, since it doesn't allow writing past the end of this header. Rewrite the entire module to use an `ArcStringPtr` abstraction instead, which allows to easily write to the buffer and still have the header accessible.
Contributor
Author
|
The MSRV check fails because of
|
ParkMyCar
requested changes
Jun 10, 2022
Owner
ParkMyCar
left a comment
There was a problem hiding this comment.
Thanks for making these changes! Just see the one comment around deleting the arc module since it's not used anymore, after that we should be good to go!
Before, the miriflags didn't work correctly because they had a typo. Fix the typo, and also use the new strict-provenance option which implies the two used before.
The module is unused and can therefore be removed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When creating a
BoxStringusingfrom_stringorfrom_box_str,str::as_ptrwas used to get the pointer, which only has read provenance for the initialized part of the string. Going throughVecin thefrom_stringand throughBox::into_rawin thefrom_box_strcase fixed the issue.Using proper miri flags (
MIRIFLAGS=-Zmiri-strict-provenance) miri also complains aboutrepr::arc, which is wrong since it uses a zero length array to be a fake custom dst, which is not allowed.